/**
 * Created by LUOLIANG on 2016/5/16.
 */

var index = avalon.define({
    $id: "index",
    url: "welcome",
    list: "",
    data: '1234',
    user: "",
});

// 顶部navbar控制器
var navbar = avalon.define({
    $id: "navbar",
    user: "",
    // index页面加载的时候通过ajax向后台请求数据获取当前登录的用户信息
    load: function () {
        $.ajax({
            type: "POST",
            url: "currentuser",
            data: {},
            success: function (data) {
                navbar.user = data;
            }
        })
    },

    getHome: function () {
        $.ajax({
            type: 'POST',
            url: '/CounterDrops/index/home',
            data: {},
            success: function (data) {

            },
            error: function (e) {

            }
        })
    }
});
